<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动</title>
    <style>
      .dason{
        float: left;
          width: 200px;
          height: 200px;
          background-color: red;
      }
      .erson{
        float: left;
          width: 200px;
          height: 200px;
          background-color: purple;
      }
      .bottom{
          height: 100px;
          background-color: black;
      }
      /* 第一种方法清除浮动  */
      /* .clear{        
          clear: both;
      } */
       /* 第二种方法单伪元素法 */
       /* .box::after{
          content: "";
          display: block;
          clear: both;
       } */
        /* 第三种方法双伪元素法 */
        /* .box::before,.box::after{
          content: "";
          display: table;
        }
        .box::after{
          clear: both;
        } */
         /* 多地方清除浮动 */
         .clearfix::before,
         .clearfix::after{
          content: "";
          display: table;
        }
        .clearfix::after{
          clear: both;
         }
    </style>
</head>
<body>
    <div class="box clearfix">
        <div class="dason">大儿子</div>
        <div class="erson">二儿子</div>
        <!-- 第一种方法<div class="clear"></div> -->
    </div>
    <div class="bottom">底部盒子</div>
</body>
</html>